package com.me.study.javaCore.regex;

import org.junit.Test;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 正则表达式
 *
 * @author ME
 */
public class TestPattern {

    /** 匹配汉字、中文标点 */
    @Test
    public void hanzi() {
        Pattern pattern = Pattern.compile("[\\w、！（）“”\\u4e00-\\u9fa5]+");
        Matcher matcher = pattern.matcher("永盛、打开、500");
        if (matcher.find()) {
            System.out.println(matcher.group(0));
        }
    }

}
